package com.gupaoedu.anothermybatis;

import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;

/**
 * @author ：sunpy
 * @date ：Created in 2019/12/11 21:32
 * @description：${description}
 */
public class GPConfiguration {
    public <T> T getMapper(Class<T> clazz,GPSqlSession sqlSession) {
        return (T)Proxy.newProxyInstance(this.getClass().getClassLoader(),new Class[]{clazz},new GPMapperProxy(sqlSession));
    }

    static class TestMapperXml{
        static final String nameSpace = "com.gupaoedu.anothermybatis.TestMapper";

        static final Map<String,String> methodSqlMapping = new HashMap<>();

        static {
            methodSqlMapping.put("selectByprimaryKey","select * from test where id = %d");
        }
    }
}
